var the_no='';
        var vm =new Vue(
            {
            el:"#app",
            data:{
                    arrStu:[
                        {no:'20210101',
                        name:'王诗雨',
                        sex:'女',
                        birth:'2001-8-6',
                        iclass:'信息20-1班',
                        address:'12号楼'
                        },
                        {no:'20210102',
                        name:'苏俊逸',
                        sex:'男',
                        birth:'2001-8-7',
                        iclass:'信息20-1班',
                        address:'11号楼'
                        },
                        {no:'20210103',
                        name:'王琳欣',
                        sex:'女',
                        birth:'2001-8-8',
                        iclass:'信息20-1班',
                        address:'12号楼'
                        }
                    ],
                    arrStu_new:[
                    {no:'20210101',
                        name:'王诗雨',
                        sex:'女',
                        birth:'2001-8-6',
                        iclass:'信息20-1班',
                        address:'12号楼'
                        },
                        {no:'20210102',
                        name:'苏俊逸',
                        sex:'男',
                        birth:'2001-8-7',
                        iclass:'信息20-1班',
                        address:'11号楼'
                        },
                        {no:'20210103',
                        name:'王琳欣',
                        sex:'女',
                        birth:'2001-8-8',
                        iclass:'信息20-1班',
                        address:'12号楼'
                        }
                    ],
                    sleop:'全部',
                    quanbu:'0',
                    xuhao:'1',
                    xuehao:'2',
                    xingming:'3',
                    xingbie:'4',
                    riqi:'5',
                    banji:'6',
                    sushe:'7',
                        sstxt:"",
                        xinzeng:"新增",
                        no:"",
                        name:"",
                        sex:"",
                        birth:"",
                        iclass:"",
                        address:"",
                },
                methods:{
                        addStu:function(){

                            var isroll=1;
                            var s = {
                                xh:this.addStu.length+1,
                                no:this.no,
                                name:this.name,
                                sex:this.sex,
                                birth:this.birth,
                                iclass:this.iclass,
                                address:this.address
                            };
                        if(this.xinzeng=="新增"){
                            if(!(this.no&&this.name&&this.birth&&this.address)){
                                alert("学号或姓名或生日或地址不可为空!");
                                this.no="";
                                this.name = "";
                                this.sex = "";
                                this.birth = "";
                                this.iclass = "";
                                this.address = "";
                            }else{
                                    for(var i=0; i<this.arrStu.length;i++){
                                        if(this.arrStu[i].no==this.no){
                                            isroll=0;
                                            break;
                                        }  
                                    }
                                        if(isroll==0){
                                            alert("学号不可重复!");
                                            this.no="";
                                            this.name = "";
                                            this.sex = "";
                                            this.birth = "";
                                            this.iclass = "";
                                            this.address = "";
                                            }else{
                                                this.arrStu.push(s);
                                            }
                                } 
                        }
                        else if(this.xinzeng=="保存"){
                            for(var i=0; i<this.arrStu.length;i++){
                                    if(this.arrStu[i].no==the_no){
                                        var the_i=i;
                                        if(!(this.no&&this.name&&this.birth&&this.address)){
                                                alert("学号或姓名或生日或地址不可为空!");
                                                this.no="";
                                                this.name = "";
                                                this.sex = "";
                                                this.birth = "";
                                                this.iclass = "";
                                                this.address = "";
                                            }else{
                                                for(var i=0; i<this.arrStu.length;i++){
                                                    if(this.arrStu[i].no==this.no&&this.no!=the_no){
                                                        isroll=0;
                                                        break;
                                                    }
                                                }
                                                if(isroll==0){
                                                    alert("学号不可和其他的重复!");
                                                    this.no="";
                                                    this.name = "";
                                                    this.sex = "";
                                                    this.birth = "";
                                                    this.iclass = "";
                                                    this.address = "";
                                                    }else{
                                                        this.arrStu[the_i].no=s.no;
                                                        this.arrStu[the_i].name=s.name;
                                                        this.arrStu[the_i].sex=s.sex;
                                                        this.arrStu[the_i].birth=s.birth;
                                                        this.arrStu[the_i].iclass=s.iclass;
                                                        this.arrStu[the_i].address=s.address;
                                                    }
                                }
                                        this.xinzeng="新增";
                                        break;
                                    }
                                }
                        }
                                this.no="";
                                this.name = "";
                                this.sex = "";
                                this.birth = "";
                                this.iclass = "";
                                this.address = "";
                                this.sleop="全部";
                            this.searchStu();
                    },
                            
                        delStu(_no){
                            for(var i=0;i<this.arrStu.length;i++){
                                if(this.arrStu[i].no==_no)
                                this.arrStu.splice(i,1);
                            }
                            this.sleop="全部";
                            this.searchStu();
                        },
                        modStu(_no){
                            the_no=_no;
                            this.xinzeng="保存";
                            for(var i=0; i<this.arrStu.length;i++){
                                if(this.arrStu[i].no==_no){
                                    this.no=this.arrStu[i].no;
                                    this.name=this.arrStu[i].name;
                                    this.sex=this.arrStu[i].sex;
                                    this.birth=this.arrStu[i].birth;
                                    this.iclass=this.arrStu[i].iclass;
                                    this.address=this.arrStu[i].address;
                                    break;
                                }
                            }
                            this.sleop="全部";
                            this.searchStu();
                        },

                        searchStu(){
                            if(this.sleop=="全部"){
                                this.arrStu_new.splice(i,this.arrStu_new.length);
                                 var isroll=1;
                                for(var i=0; i<this.arrStu.length;i++){
                                    var s1={
                                                xh:i+1,
                                                no:this.arrStu[i].no, 
                                                name:this.arrStu[i].name, 
                                                sex:this.arrStu[i].sex,
                                                birth:this.arrStu[i].birth,
                                                iclass:this.arrStu[i].iclass,
                                                address:this.arrStu[i].address 
                                            }
                                    for(var j=0; j<this.arrStu_new.length;j++){
                                        if(this.arrStu[i].no==this.arrStu_new[j].no){
                                            isroll=0;
                                        } 
                                    }
                                        if(isroll==1){
                                            this.arrStu_new.push(s1);
                                            isroll==1;
                                        } 


                                }
                              for(var i=0;i<this.arrStu_new.length;i++){
                                    if(!this.arrStu_new[i].no)
                                    this.arrStu_new.splice(i,1);
                                } 
                            }

                            else if(this.sleop=="按照学号搜索"){
                                this.arrStu_new.splice(i,this.arrStu_new.length);
                                alert(this.sleop);
                                 var isroll=1;
                                for(var i=0; i<this.arrStu.length;i++){
                                    var s1={
                                                xh:i+1,
                                                no:this.arrStu[i].no, 
                                                name:this.arrStu[i].name, 
                                                sex:this.arrStu[i].sex,
                                                birth:this.arrStu[i].birth,
                                                iclass:this.arrStu[i].iclass,
                                                address:this.arrStu[i].address 
                                            }
                                    for(var j=0; j<this.arrStu_new.length;j++){
                                        if(this.arrStu[i].no==this.arrStu_new[j].no){
                                            isroll=0;
                                        } 
                                    }
                                        if(isroll==1&&this.arrStu[i].no.match(this.sstxt)){
                                            this.arrStu_new.push(s1);
                                            isroll==1;
                                        } 


                                }
                              for(var i=0;i<this.arrStu_new.length;i++){
                                    if(!this.arrStu_new[i].no)
                                    this.arrStu_new.splice(i,1);
                                }  
                            }else if(this.sleop=="按照姓名搜索"){
                                this.arrStu_new.splice(i,this.arrStu_new.length);
                               
                               alert(this.sleop);
                                var isroll=1;

                               for(var i=0; i<this.arrStu.length;i++){
                                   var s1={
                                               xh:i+1,
                                               no:this.arrStu[i].no, 
                                               name:this.arrStu[i].name, 
                                               sex:this.arrStu[i].sex,
                                               birth:this.arrStu[i].birth,
                                               iclass:this.arrStu[i].iclass,
                                               address:this.arrStu[i].address 
                                           }
                                   for(var j=0; j<this.arrStu_new.length;j++){
                                       if(this.arrStu[i].no==this.arrStu_new[j].no){
                                           isroll=0;
                                       } 
                                   }
                                       if(isroll==1&&this.arrStu[i].name.match(this.sstxt)){
                                           this.arrStu_new.push(s1);
                                           isroll==1;
                                       } 
                               }
                             for(var i=0;i<this.arrStu_new.length;i++){
                                   if(!this.arrStu_new[i].no)
                                   this.arrStu_new.splice(i,1);
                               }  
                            }
                        }
                    },
                },
        );